"use strict";
const Joi = require('joi');
const CheckUtil = require("../utils/check");
const BasicsCtl = require("../basics/clz/basectl");
const HomeImpl = require("../service/home");

class HomeCtl extends BasicsCtl {

  constructor(context) {
    super(context);
    this.homeImpl = new HomeImpl(this.cloud);
  }


  /**
   * 奖品列表
   */
  async findList() {
    return await this.homeImpl.findList();
  }

  /**
   * 编辑优惠券
   */
  async edit() {
    const rule = {
      code: Joi.string().required()
    };
    CheckUtil.validate(rule, this.params);
    return await this.homeImpl.edit(this.params);
  }


}
module.exports = HomeCtl;